import { createRouter, createWebHistory } from 'vue-router'
import Admin from '@/loyouts/Admin.vue'
import AboutView from '@/views/AboutView.vue'
import Login from '@/views/Login.vue'
import NotFound from '@/views/404.vue'
import Index from '@/views/main/Index.vue'
import GoodList from "@/views/goods/List.vue"

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'admin',
      component: Admin,
      children: [
        {
          path: '/',
          component: Index,
        },
        {
          path: '/goods/list',
          component: GoodList,
        },
      ],
    }, {
      path: '/about',
      name: 'about',
      component: AboutView
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: NotFound
    },
  ]
})

export default router
